A Typed Calculus Supporting Shallow Embeddings of Abstract Machines
نویسندگان
چکیده
machines and reductions in a system of proof terms for a version the sequent calculus. We believe that by doing so we shed light on some essential characteristics of abstract machines, proofs in sequent calculus systems, and weak normalization of λ-terms. The machines that we consider are the (callby-name) Krivine machine and a call-by-value machine that may be called a “right-to-left CEK machine” but with some modifications can be seen as a proto-ZINC machine. The formal connection we exhibit is, in fact, an embedding of the machines into the term calculus. We embed run-time data structures, such as the control stack and environment, in such a way that the operational semantics of the machine corresponds to reduction steps in the calculus. The abstract machine state, including the code that it executes, is captured as a term; the abstract machine transitions are captured as term reductions. This is in contrast to specifying the operational semantics on top of the calculus. In other words, our goal is to provide a shallow embedding of an abstract machine in a calculus/logic, as opposed to a deep embedding. This allows reasoning about the machine inside the logic itself instead of on top of it. The logical formulae that are assigned to proof terms provide a type system for the term language via the Curry-Howard isomorphism, and because of the method of embedding the machines into the terms, this type system can be directly lifted to the machine code and machine states, thereby allowing an elegant and simple formulation of safety, based on the subject reduction theorem of the calculus.
منابع مشابه
Refinements in Typed Abstract State Machines
While Abstract State Machines (ASMs) provide a general purpose development method, it is advantageous to provide extensions that ease their use in particular application areas. This paper focuses on such extensions for the benefit of a “refinement calculus” in the area of data warehouses and on-line analytical processing (OLAP). We show that providing typed ASMs helps to exploit the existing lo...
متن کاملDatabase Query Languages Embedded in the Typed Lambda Calculus
We investigate the expressive power of the typed-calculus when expressing computations over nite structures, i.e., databases. We show that the simply typed-calculus can express various database query languages such as the relational algebra, xpoint logic, and the complex object algebra. In our embeddings, inputs and outputs are-terms encoding databases, and a program expressing a query is a-ter...
متن کاملOn Explicit Substitutions and Names
machines and sharing.Our presentation of a explicit substitution cal-culus has been driven by the correspondence withthe semantics. Of the calculi discussed above, theoriginal -calculus of Abadi et al. [1] is the onlyone with a closer correspondence to a categoricalsemantics. We see our calculus as a direct improve-ment of theirs. Moreover, in earlier work [14] Ritte...
متن کاملFunctions as Session-Typed Processes
We study type-directed encodings of the simply-typed λ-calculus in a session-typed π-calculus. The translations proceed in two steps: standard embeddings of simply-typed λ-calculus in a linear λ-calculus, followed by a standard translation of linear natural deduction to linear sequent calculus. We have shown in prior work how to give a Curry-Howard interpretation of the proofs in the linear seq...
متن کاملEfficient, Correct Abstract Machines for Stochastic Process Calculi with Mobile Compartments
This paper describes a general approach for deriving efficient, correct abstract machines for stochastic process calculi with nested mobile compartments. The approach is applied to the Bioambient calculus and the Brane calculus. Interestingly, the abstract machines for both calculi can be defined from a common machine that supports both sets of synchronisation primitives. This illustrates the f...
متن کامل